//package com.kjc.demo.basic.nacos;
//
//import java.util.HashMap;
//import java.util.Map;
//
//import com.alibaba.nacos.api.exception.NacosException;
//import com.alibaba.nacos.api.naming.NamingFactory;
//import com.alibaba.nacos.api.naming.NamingService;
//import com.alibaba.nacos.api.naming.pojo.AbstractHealthChecker;
//import com.alibaba.nacos.api.naming.pojo.Cluster;
//import com.alibaba.nacos.api.naming.pojo.Instance;
//import com.alibaba.nacos.api.naming.pojo.Service;
//
//public class NamingServiceDemo {
//	public static void main(String[] args) throws NacosException {
//		NamingService naming = NamingFactory.createNamingService(System.getProperty("serveAddr"));
//		naming.registerInstance("nacos.test.3", "11.11.11.11", 8888, "TEST1");
//
//		Instance instance = new Instance();
//		instance.setIp("55.55.55.55");
//		instance.setPort(9999);
//		instance.setHealthy(false);
//		instance.setWeight(2.0);
//		Map<String, String> instanceMeta = new HashMap<>();
//		instanceMeta.put("site", "et2");
//		instance.setMetadata(instanceMeta);
//
//		Service service = new Service("nacos.test.4");
//		service.setAppName("nacos-naming");
////		service.sethealthCheckMode("server");
////		service.setEnableHealthCheck(true);
//		service.setProtectThreshold(0.8F);
//		service.setGroupName("CNCF");
//		Map<String, String> serviceMeta = new HashMap<>();
//		serviceMeta.put("symmetricCall", "true");
//		service.setMetadata(serviceMeta);
////		instance.setService(service);
//
//		Cluster cluster = new Cluster();
//		cluster.setName("TEST5");
//		AbstractHealthChecker.Http healthChecker = new AbstractHealthChecker.Http();
//		healthChecker.setExpectedResponseCode(400);
////		healthChecker.setCurlHost("USer-Agent|Nacos");
////		healthChecker.setCurlPath("/xxx.html");
//		cluster.setHealthChecker(healthChecker);
//		Map<String, String> clusterMeta = new HashMap<>();
//		clusterMeta.put("xxx", "yyyy");
//		cluster.setMetadata(clusterMeta);
//
////		instance.setCluster(cluster);
//
////		naming.registerInstance("nacos.test.4", instance);
//	}
//}
